package Leo.serviceClient.feign;

import Leo.serviceClient.entity.Member;
import Leo.serviceClient.entity.Result;
import Leo.serviceClient.entity.User;
import feign.Feign;
import feign.Param;
import feign.jaxb.JAXBContextFactory;
import feign.jaxb.JAXBDecoder;
import feign.jaxb.JAXBEncoder;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.context.annotation.Bean;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "FAQ-Service-Provider"
//        ,configuration = {XmlConfig.class}
)
public interface XmlClient {

    @RequestMapping(value = "/xmlUser", method = RequestMethod.POST //指定访问方法
            , consumes = MediaType.APPLICATION_XML_VALUE //指定处理请求的提交内容类型（Content-Type）
            ,produces = MediaType.APPLICATION_XML_VALUE  //指定返回值类型，不但可以设置返回值类型还可以设定返回值的字符编码)
    )
    String getXmlUser(Member user);

    @RequestMapping(value = "/stringUser", method = RequestMethod.POST)
    String stringUser(@RequestParam(value = "content") String user);
}
